inherited dmProcessReporting: TdmProcessReporting
  inherited qryMaster: TFDQuery
    BeforeOpen = qryMasterBeforeOpen
    CachedUpdates = True
    Connection = UniMainModule.BoConnection
    SQL.Strings = (
      '--declare @docCode varchar(20)'
      '--set @docCode = :docCode'
      'SELECT '
      
        'TransformId, DocCode, DocDate, MoId, MoDId, MoRoutingId, MoRouti' +
        'ngDId, TransformType, OpStatus, TransOutQty, '
      
        'InMoRoutingDId, QualifiedQty, ScrapQty, RefusedQty, DeclareQty, ' +
        'MachiningQty, DeclaredQty, Remark, CreateDate, '
      
        'CreateTime, CreateUser, ModifyDate, ModifyTime, ModifyUser, UpdC' +
        'ount , Define1, Define2, Define3, Define4, Define5, '
      
        'Define6, Define7, Define8, Define9, Define10, Define11, Define12' +
        ', Define13, Define14, Define15, Define16 , VTid, '
      
        'QcFlag, OutQcFlag, InAuxUnitCode, inchangerate,ReasonCode, Quali' +
        'fiedReasonCode, RefusedReasonCode, ScrapReasonCode,QcType,CheckI' +
        'd,WorkHrId, Status, BFedFlag, '
      
        'DocTime,PFReportDId,PFReportId,PFDId,RefDocType,RefDocDId,RefDoc' +
        'Code,ReworkFlag,OrgDocCode '
      'FROM sfc_optransform'
      'WHERE'
      '  1 <> 1'
      '  -- DocCode like '#39'%'#39' + @docCode + '#39'%'#39)
    object qryMasterTransformId: TIntegerField
      FieldName = 'TransformId'
      Origin = 'TransformId'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qryMasterDocCode: TWideStringField
      FieldName = 'DocCode'
      Origin = 'DocCode'
      Required = True
      Size = 30
    end
    object qryMasterDocDate: TSQLTimeStampField
      FieldName = 'DocDate'
      Origin = 'DocDate'
    end
    object qryMasterMoId: TIntegerField
      FieldName = 'MoId'
      Origin = 'MoId'
    end
    object qryMasterMoDId: TIntegerField
      FieldName = 'MoDId'
      Origin = 'MoDId'
    end
    object qryMasterMoRoutingId: TIntegerField
      FieldName = 'MoRoutingId'
      Origin = 'MoRoutingId'
    end
    object qryMasterMoRoutingDId: TIntegerField
      FieldName = 'MoRoutingDId'
      Origin = 'MoRoutingDId'
    end
    object qryMasterTransformType: TByteField
      FieldName = 'TransformType'
      Origin = 'TransformType'
    end
    object qryMasterOpStatus: TSmallintField
      FieldName = 'OpStatus'
      Origin = 'OpStatus'
    end
    object qryMasterTransOutQty: TFMTBCDField
      FieldName = 'TransOutQty'
      Origin = 'TransOutQty'
      Precision = 28
      Size = 6
    end
    object qryMasterInMoRoutingDId: TIntegerField
      FieldName = 'InMoRoutingDId'
      Origin = 'InMoRoutingDId'
    end
    object qryMasterQualifiedQty: TFMTBCDField
      FieldName = 'QualifiedQty'
      Origin = 'QualifiedQty'
      Precision = 28
      Size = 6
    end
    object qryMasterScrapQty: TFMTBCDField
      FieldName = 'ScrapQty'
      Origin = 'ScrapQty'
      Precision = 28
      Size = 6
    end
    object qryMasterRefusedQty: TFMTBCDField
      FieldName = 'RefusedQty'
      Origin = 'RefusedQty'
      Precision = 28
      Size = 6
    end
    object qryMasterDeclareQty: TFMTBCDField
      FieldName = 'DeclareQty'
      Origin = 'DeclareQty'
      Precision = 28
      Size = 6
    end
    object qryMasterMachiningQty: TFMTBCDField
      FieldName = 'MachiningQty'
      Origin = 'MachiningQty'
      Precision = 28
      Size = 6
    end
    object qryMasterDeclaredQty: TFMTBCDField
      FieldName = 'DeclaredQty'
      Origin = 'DeclaredQty'
      Precision = 28
      Size = 6
    end
    object qryMasterRemark: TWideStringField
      FieldName = 'Remark'
      Origin = 'Remark'
      Size = 255
    end
    object qryMasterCreateDate: TSQLTimeStampField
      FieldName = 'CreateDate'
      Origin = 'CreateDate'
    end
    object qryMasterCreateTime: TSQLTimeStampField
      FieldName = 'CreateTime'
      Origin = 'CreateTime'
    end
    object qryMasterCreateUser: TWideStringField
      FieldName = 'CreateUser'
      Origin = 'CreateUser'
    end
    object qryMasterModifyDate: TSQLTimeStampField
      FieldName = 'ModifyDate'
      Origin = 'ModifyDate'
    end
    object qryMasterModifyTime: TSQLTimeStampField
      FieldName = 'ModifyTime'
      Origin = 'ModifyTime'
    end
    object qryMasterModifyUser: TWideStringField
      FieldName = 'ModifyUser'
      Origin = 'ModifyUser'
    end
    object qryMasterUpdCount: TIntegerField
      FieldName = 'UpdCount'
      Origin = 'UpdCount'
    end
    object qryMasterDefine1: TWideStringField
      FieldName = 'Define1'
      Origin = 'Define1'
    end
    object qryMasterDefine2: TWideStringField
      FieldName = 'Define2'
      Origin = 'Define2'
    end
    object qryMasterDefine3: TWideStringField
      FieldName = 'Define3'
      Origin = 'Define3'
    end
    object qryMasterDefine4: TSQLTimeStampField
      FieldName = 'Define4'
      Origin = 'Define4'
    end
    object qryMasterDefine5: TIntegerField
      FieldName = 'Define5'
      Origin = 'Define5'
    end
    object qryMasterDefine6: TSQLTimeStampField
      FieldName = 'Define6'
      Origin = 'Define6'
    end
    object qryMasterDefine7: TFloatField
      FieldName = 'Define7'
      Origin = 'Define7'
    end
    object qryMasterDefine8: TWideStringField
      FieldName = 'Define8'
      Origin = 'Define8'
      Size = 4
    end
    object qryMasterDefine9: TWideStringField
      FieldName = 'Define9'
      Origin = 'Define9'
      Size = 8
    end
    object qryMasterDefine10: TWideStringField
      FieldName = 'Define10'
      Origin = 'Define10'
      Size = 60
    end
    object qryMasterDefine11: TWideStringField
      FieldName = 'Define11'
      Origin = 'Define11'
      Size = 120
    end
    object qryMasterDefine12: TWideStringField
      FieldName = 'Define12'
      Origin = 'Define12'
      Size = 120
    end
    object qryMasterDefine13: TWideStringField
      FieldName = 'Define13'
      Origin = 'Define13'
      Size = 120
    end
    object qryMasterDefine14: TWideStringField
      FieldName = 'Define14'
      Origin = 'Define14'
      Size = 120
    end
    object qryMasterDefine15: TIntegerField
      FieldName = 'Define15'
      Origin = 'Define15'
    end
    object qryMasterDefine16: TFloatField
      FieldName = 'Define16'
      Origin = 'Define16'
    end
    object qryMasterVTid: TIntegerField
      FieldName = 'VTid'
      Origin = 'VTid'
    end
    object qryMasterQcFlag: TBooleanField
      FieldName = 'QcFlag'
      Origin = 'QcFlag'
    end
    object qryMasterOutQcFlag: TBooleanField
      FieldName = 'OutQcFlag'
      Origin = 'OutQcFlag'
    end
    object qryMasterInAuxUnitCode: TWideStringField
      FieldName = 'InAuxUnitCode'
      Origin = 'InAuxUnitCode'
      Size = 35
    end
    object qryMasterinchangerate: TFMTBCDField
      FieldName = 'inchangerate'
      Origin = 'inchangerate'
      Precision = 22
      Size = 6
    end
    object qryMasterReasonCode: TWideStringField
      FieldName = 'ReasonCode'
      Origin = 'ReasonCode'
      Size = 10
    end
    object qryMasterQualifiedReasonCode: TWideStringField
      FieldName = 'QualifiedReasonCode'
      Origin = 'QualifiedReasonCode'
      Size = 10
    end
    object qryMasterRefusedReasonCode: TWideStringField
      FieldName = 'RefusedReasonCode'
      Origin = 'RefusedReasonCode'
      Size = 10
    end
    object qryMasterScrapReasonCode: TWideStringField
      FieldName = 'ScrapReasonCode'
      Origin = 'ScrapReasonCode'
      Size = 10
    end
    object qryMasterQcType: TByteField
      FieldName = 'QcType'
      Origin = 'QcType'
    end
    object qryMasterCheckId: TIntegerField
      FieldName = 'CheckId'
      Origin = 'CheckId'
    end
    object qryMasterWorkHrId: TIntegerField
      FieldName = 'WorkHrId'
      Origin = 'WorkHrId'
    end
    object qryMasterStatus: TByteField
      FieldName = 'Status'
      Origin = 'Status'
    end
    object qryMasterBFedFlag: TBooleanField
      FieldName = 'BFedFlag'
      Origin = 'BFedFlag'
    end
    object qryMasterDocTime: TSQLTimeStampField
      FieldName = 'DocTime'
      Origin = 'DocTime'
    end
    object qryMasterPFReportDId: TIntegerField
      FieldName = 'PFReportDId'
      Origin = 'PFReportDId'
    end
    object qryMasterPFReportId: TIntegerField
      FieldName = 'PFReportId'
      Origin = 'PFReportId'
    end
    object qryMasterPFDId: TIntegerField
      FieldName = 'PFDId'
      Origin = 'PFDId'
    end
    object qryMasterRefDocType: TByteField
      FieldName = 'RefDocType'
      Origin = 'RefDocType'
    end
    object qryMasterRefDocDId: TIntegerField
      FieldName = 'RefDocDId'
      Origin = 'RefDocDId'
    end
    object qryMasterRefDocCode: TWideStringField
      FieldName = 'RefDocCode'
      Origin = 'RefDocCode'
      Size = 30
    end
    object qryMasterReworkFlag: TBooleanField
      FieldName = 'ReworkFlag'
      Origin = 'ReworkFlag'
    end
    object qryMasterOrgDocCode: TWideStringField
      FieldName = 'OrgDocCode'
      Origin = 'OrgDocCode'
      Size = 60
    end
    object qryMasterInvCode: TStringField
      FieldKind = fkLookup
      FieldName = 'InvCode'
      LookupDataSet = qryDetails
      LookupKeyFields = 'oMoRoutingDId'
      LookupResultField = 'InvCode'
      KeyFields = 'MoRoutingDId'
      Lookup = True
    end
    object qryMasterInvName: TStringField
      FieldKind = fkLookup
      FieldName = 'InvName'
      LookupDataSet = qryDetails
      LookupKeyFields = 'oMoRoutingDId'
      LookupResultField = 'InvName'
      KeyFields = 'MoRoutingDId'
      Lookup = True
    end
    object qryMasterOpSeq: TStringField
      FieldKind = fkLookup
      FieldName = 'OpSeq'
      LookupDataSet = qryDetails
      LookupKeyFields = 'oMoRoutingDId'
      LookupResultField = 'OpSeq'
      KeyFields = 'MoRoutingDId'
      Lookup = True
    end
    object qryMasterOpSeqDesc: TStringField
      FieldKind = fkLookup
      FieldName = 'OpSeqDesc'
      LookupDataSet = qryDetails
      LookupKeyFields = 'oMoRoutingDId'
      LookupResultField = 'OpSeqDesc'
      KeyFields = 'MoRoutingDId'
      Lookup = True
    end
    object qryMasterInOpSeq: TStringField
      FieldKind = fkLookup
      FieldName = 'InOpSeq'
      LookupDataSet = qryDetails
      LookupKeyFields = 'oMoRoutingDId'
      LookupResultField = 'OpSeq'
      KeyFields = 'InMoRoutingDId'
      Lookup = True
    end
    object qryMasterInOpSeqDesc: TStringField
      FieldKind = fkLookup
      FieldName = 'InOpSeqDesc'
      LookupDataSet = qryDetails
      LookupKeyFields = 'oMoRoutingDId'
      LookupResultField = 'OpSeqDesc'
      KeyFields = 'InMoRoutingDId'
      Lookup = True
    end
    object qryMasterWcName: TStringField
      FieldKind = fkLookup
      FieldName = 'WcName'
      LookupDataSet = qryDetails
      LookupKeyFields = 'oMoRoutingDId'
      LookupResultField = 'WcName'
      KeyFields = 'MoRoutingDId'
      Lookup = True
    end
    object qryMasterInWcName: TStringField
      FieldKind = fkLookup
      FieldName = 'InWcName'
      LookupDataSet = qryDetails
      LookupKeyFields = 'oMoRoutingDId'
      LookupResultField = 'WcName'
      KeyFields = 'InMoRoutingDId'
      Lookup = True
    end
  end
  object qryBarCode: TFDQuery
    Connection = UniMainModule.BoConnection
    SQL.Strings = (
      'select * from sfc_moroutingdetail'
      'where'
      '  cbSysBarCode= :cbSysBarCode')
    Left = 232
    Top = 16
    ParamData = <
      item
        Name = 'CBSYSBARCODE'
        DataType = ftString
        ParamType = ptInput
        Value = ''
      end>
  end
  object qryMoroutingdetail: TFDQuery
    Connection = UniMainModule.BoConnection
    SQL.Strings = (
      'SELECT '
      '  A.mocode ,'
      '  A.CreateTime ,'
      '  C.OpSeq ,'
      '  C.Description ,'
      '  C.BalMachiningQty,'
      '  C.ReportQty ,'
      '  C.BalQualifiedQty ,'
      '  C.BalRefusedQty,'
      '  C.BalScrapQty ,'
      '  C.CompleteQty ,'
      '  C.subFlag,'
      '  C.cbSysBarCode,'
      '  C.FirstFlag,'
      '  C.LastFlag,'
      '  B.MoId,'
      '  B.MoDId,'
      '  C.MoRoutingId,'
      '  C.MoRoutingDId'
      'FROM'
      '  mom_order A,'
      '  mom_orderdetail B, '
      '  sfc_moroutingdetail C'
      'WHERE'
      '  A.MoId = B.MoId'
      '  AND'
      '  B.MoDId = C.MoDId'
      '  AND'
      '  A.MoId = :MoId'
      'order by'
      '  C.OpSeq')
    Left = 56
    Top = 120
    ParamData = <
      item
        Name = 'MOID'
        DataType = ftInteger
        ParamType = ptInput
        Value = 0
      end>
  end
  object qryDynamic: TFDQuery
    Connection = UniMainModule.BoConnection
    SQL.Strings = (
      'select * from sfc_moroutingdetail'
      'where'
      '  cbSysBarCode= :cbSysBarCode')
    Left = 152
    Top = 16
    ParamData = <
      item
        Name = 'CBSYSBARCODE'
        DataType = ftString
        ParamType = ptInput
        Value = ''
      end>
  end
  object sp_GenOptransCode: TFDStoredProc
    Connection = UniMainModule.BoConnection
    StoredProcName = 'sp_GenOptransCode'
    Left = 304
    Top = 216
    ParamData = <
      item
        Position = 2
        Name = '@OptransformCode'
        DataType = ftString
        ParamType = ptInputOutput
        Size = 20
      end>
  end
  object sp_GetID: TFDStoredProc
    Connection = UniMainModule.BoConnection
    StoredProcName = 'sp_GetID'
    Left = 304
    Top = 288
    ParamData = <
      item
        Position = 1
        Name = '@RETURN_VALUE'
        DataType = ftInteger
        ParamType = ptResult
      end
      item
        Position = 2
        Name = '@RemoteId'
        DataType = ftWideString
        ParamType = ptInput
        Size = 2
      end
      item
        Position = 3
        Name = '@cAcc_Id'
        DataType = ftWideString
        ParamType = ptInput
        Size = 3
      end
      item
        Position = 4
        Name = '@cVouchType'
        DataType = ftWideString
        ParamType = ptInput
        Size = 50
      end
      item
        Position = 5
        Name = '@iAmount'
        DataType = ftInteger
        ParamType = ptInput
      end
      item
        Position = 6
        Name = '@iFatherId'
        DataType = ftInteger
        ParamType = ptInputOutput
      end
      item
        Position = 7
        Name = '@iChildId'
        DataType = ftInteger
        ParamType = ptInputOutput
      end
      item
        Position = 8
        Name = '@bEnableNewRule'
        DataType = ftBoolean
        ParamType = ptInput
      end>
  end
  object Usp_SF_UpdMoRoutingBalQtyByTransFrom: TFDStoredProc
    BeforeExecute = Usp_SF_UpdMoRoutingBalQtyByTransFromBeforeExecute
    Connection = UniMainModule.BoConnection
    StoredProcName = 'Usp_SF_UpdMoRoutingBalQtyByTransFrom'
    Left = 312
    Top = 96
  end
  object Usp_SF_UpdMoRoutingQtyByTransFrom: TFDStoredProc
    Connection = UniMainModule.BoConnection
    StoredProcName = 'Usp_SF_UpdMoRoutingQtyByTransFrom'
    Left = 312
    Top = 160
    ParamData = <
      item
        Position = 1
        Name = '@RETURN_VALUE'
        DataType = ftInteger
        ParamType = ptResult
      end
      item
        Position = 2
        Name = '@v_transformid'
        DataType = ftInteger
        ParamType = ptInput
      end
      item
        Position = 3
        Name = '@v_type'
        DataType = ftInteger
        ParamType = ptInput
      end>
  end
  object qryDetails: TFDQuery
    BeforeOpen = qryDetailsBeforeOpen
    CachedUpdates = True
    Connection = UniMainModule.BoConnection
    SQL.Strings = (
      'SELECT'
      '  mh.mocode,'
      '  mh.MoId,'
      '  md.MoDId,'
      '  omr.MoRoutingDId AS oMoRoutingDId,'
      '  ii.cInvCode AS InvCode,'
      '  ii.cInvAddCode AS InvAddCode,'
      '  ii.cInvName AS InvName,'
      '  ii.cInvStd AS InvStd,'#9
      '  omr.OpSeq AS OpSeq,'
      '  omr.Description AS OpSeqDesc,'
      '  ow.WcCode AS WcCode,'
      '  ow.Description AS WcName'
      'FROM'
      '  mom_order mh WITH ( nolock ) '
      
        '  INNER JOIN mom_orderdetail AS md WITH ( nolock ) ON mh.MoId = ' +
        'md.MoId'
      
        '  INNER JOIN bas_part AS ip WITH ( nolock ) ON md.partid = ip.pa' +
        'rtid'
      
        '  INNER JOIN inventory AS ii WITH ( nolock ) ON ii.cinvcode = ip' +
        '.invcode'
      
        '  INNER JOIN ComputationUnit AS iu WITH ( nolock ) ON ii.cComuni' +
        'tCode = iu.cComUnitCode'#9
      
        '  INNER JOIN sfc_moroutingdetail AS omr WITH ( nolock ) ON omr.M' +
        'oDId = md.MoDId'
      
        '  LEFT OUTER JOIN sfc_workcenter AS ow WITH ( nolock ) ON ow.WcI' +
        'd = omr.WcId')
    Left = 64
    Top = 208
  end
end
